import request from '@/utils/request'

export function getEmailList(params) {
  return request({
    url: '/email/list',
    method: 'get',
    params
  })
}

export function sendPersonalEmail(data) {
  return request({
    url: '/email/personal/send',
    method: 'post',
    data
  })
}

export function sendPublicEmail(data) {
  return request({
    url: '/email/public/send',
    method: 'post',
    data
  })
}

// 获取游戏道具列表
export function fetchItemsAll(query) {
  return request({
    url: '/game/items/list',
    method: 'get',
    params: query
  })
}

export function approved(data) {
  return request({
    url: '/email/approved',
    method: 'post',
    data
  })
}

export function deleteEmail(data) {
  return request({
    url: '/email/delete',
    method: 'post',
    data
  })
}

export function getBatchEmailList(data) {
  return request({
    url: '/email/batch/list',
    method: 'post',
    data
  })
}

export function approvedBatchEmail(id) {
  return request({
    url: `/email/batch/approved/${id}`,
    method: 'patch'
  })
}

export function deleteBatchEmail(id) {
  return request({
    url: `/email/batch/delete/${id}`,
    method: 'delete'
  })
}

// 通过批量ID获取邮件列表
export function getEmailByBatchId(batchId) {
  return request({
    url: `/email/list/batch/${batchId}`,
    method: 'get'
  })
}

export function getEmailConfig(query) {
  return request({
    url: `/email/config/list`,
    method: 'get',
    params: query
  })
}

export function handleEmailConfig(data) {
  return request({
    url: '/email/config/handle',
    method: 'post',
    data
  })
}

export function handleEmailConfigStatus(data) {
  return request({
    url: '/email/config/handle/status',
    method: 'post',
    data
  })
}

// 获取登录公告列表
export function getLoginNotice(query) {
  return request({
    url: '/notice/login/list',
    method: 'get',
    query
  })
}

// 处理登录公告
export function handleLoginNotice(data) {
  return request({
    url: '/notice/login/handle',
    method: 'post',
    data
  })
}

// 删除登录公告
export function deleteLoginNotice(id) {
  return request({
    url: `/notice/login/${id}`,
    method: 'delete'
  })
}
// 获取跑马灯公告列表
export function getGameNotice(query) {
  return request({
    url: '/notice/game/list',
    method: 'get',
    query
  })
}

// 处理跑马灯公告
export function handleGameNotice(data) {
  return request({
    url: '/notice/game/handle',
    method: 'post',
    data
  })
}

// 删除跑马灯公告
export function deleteGameNotice(id) {
  return request({
    url: `/notice/game/${id}`,
    method: 'delete'
  })
}

// 获取回收物品列表
export function getItemRecoveryList(query) {
  return request({
    url: '/item/recovery/list',
    method: 'get',
    query
  })
}

// 处理回收物品
export function handleItemRecovery(data) {
  return request({
    url: '/item/recovery/handle',
    method: 'post',
    data
  })
}

// 获取充值补单列表
export function getSupplementList(query) {
  return request({
    url: '/order/supplement/list',
    method: 'get',
    params: query
  })
}

// 处理充值补单
export function handleSupplement(data) {
  return request({
    url: '/order/supplement/handle',
    method: 'post',
    data
  })
}

// 获取充值补单邮件列表
export function getSupplementEmailList(query) {
  return request({
    url: '/order/supplement/email/list',
    method: 'get',
    params: query
  })
}

// 处理充值补单邮件
export function handleSupplementEmail(data) {
  return request({
    url: '/order/supplement/email/handle',
    method: 'post',
    data
  })
}

export function approvedSupplement(data) {
  return request({
    url: '/order/supplement/email/approved',
    method: 'post',
    data
  })
}

export function deleteSupplementEmail(data) {
  return request({
    url: '/order/supplement/email/delete',
    method: 'post',
    data
  })
}

// 联盟管理
export function getUnionList(query) {
  return request({
    url: '/union/list',
    method: 'get',
    params: query
  })
}

export function getUnionLog(query) {
  return request({
    url: '/union/log',
    method: 'get',
    params: query
  })
}

export function handleUnion(data) {
  return request({
    url: '/union/handle',
    method: 'post',
    data
  })
}

// 获取指令配置列表
export function getCommandConfig(query) {
  return request({
    url: '/command/config/list',
    method: 'get',
    params: query
  })
}

// 获取指令列表
export function getCommandList(query) {
  return request({
    url: '/command/list',
    method: 'get',
    params: query
  })
}

// 处理指令
export function handleCommand(data) {
  return request({
    url: '/command/handle',
    method: 'post',
    data
  })
}
// GM账号
export function getGmAccountlist(query) {
  return request({
    url: '/gmaccount/list',
    method: 'get',
    params: query
  })
}

export function handleGmAccount(data) {
  return request({
    url: '/gmaccount/handle',
    method: 'post',
    data
  })
}

export function batchDeleteGmAccount(ids) {
  return request({
    url: `/gmaccount/batchDelete`,
    method: 'post',
    params: ids
  })
}
